package 笔试.京东;

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class 最大路径最小权重路线 {
    public static int n;
    public static int pathSum;
    public static int weightSum;
    public static int[][] matrix;
    public static boolean[][] visited;
    public static int[][] dir = {{1, 0}, {0, 1}, {-1, 0}};

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        matrix = new int[2][n];
        visited = new boolean[2][n];
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                matrix[i][j] = in.nextInt();
            }
        }
        pathSum = 0;
        weightSum = Integer.MAX_VALUE;
        visited[0][0] = true;
        dfs(0, 0, 1, matrix[0][0]);
        System.out.println(weightSum);
    }

    private static void dfs(int x, int y, int path, int weight) {
        if (x == 1 && y == n - 1) {
            pathSum = Math.max(path, pathSum);
            weightSum = Math.min(weight, weightSum);
            return;
        }
        for (int i = 0; i < 3; i++) {
            int tx = x + dir[i][0];
            int ty = y + dir[i][1];
            if (tx < 0 || tx >= 2 || ty < 0 || ty >= n) continue;
            if (!visited[tx][ty]) {
                visited[tx][ty] = true;
                dfs(tx, ty, path + 1, weight + matrix[tx][ty]);
                visited[tx][ty] = false;
            }
        }
    }
}